<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>02_charCodeAt</title>
</head>

<body>
  <script>
    /**
     * charCodeAt()
     * 语法: 字符串.charCodeAt(索引)
     * 返回值: 该索引位置的对应字符的 编码(十进制)
    */

    var str = '中hello world';
    var result = str.charCodeAt(6);
    
    console.log(result);
  </script>
</body>

</html>
